package HomeWorlk;

import java.util.HashMap;
import java.util.StringTokenizer;

public class test21 {
    public static void main(String[] args) {
        String s = "If you want to change your fate I think you must come to the dark horse to learn java";
        String s1 [] = s.split(" ");
        HashMap<String,Integer> hm = new HashMap<>();
        for (String s2 : s1) {
            Integer num = hm.get(s2);
            if (num == null){
                num=1;
            }else {
                num++;
            }
            hm.put(s2,num);
        }
        System.out.println(hm);
    }
}
